package com.yt.lxh.common.result;

import lombok.Getter;

@Getter
public enum ResultCodeEnum {
    SUCCESS(200, "成功"),

    FAIL(400, "失败"),
    INSERT_SUCCESS(200, "添加成功"),
    UPDATE_SUCCESS(200, "更新成功"),
    DELETE_SUCCESS(200, "删除成功"),
    //验证码
    VALIDATECODE_ERROR(202,"验证码错误"),
    LOGIN_AUTH(208,"用户未登录"),
    //菜单
    NODE_ERROR( 217, "该节点下有子节点，不可以删除"),
    // 登录段
    NEED_LOGIN(401,"需要登录后操作"),
    LOGIN_PASSWORD_ERROR(402,"密码错误"),
    // TOKEN
    TOKEN_INVALID(410,"无效的TOKEN"),
    TOKEN_EXPIRE(411,"TOKEN已过期"),
    TOKEN_REQUIRE(412,"TOKEN是必须的"),
    // SIGN验签
    SIGN_INVALID(420,"无效的SIGN"),
    SIG_TIMEOUT(421,"SIGN已过期"),
    // 参数错误
    PARAM_REQUIRE(430,"缺少参数"),
    PARAM_INVALID(431,"无效参数"),
    PARAM_IMAGE_FORMAT_ERROR(433,"图片格式有误"),
    // 数据错误
    DATA_EXIST(440,"数据已经存在"),
    DATA_NOT_EXIST(441,"数据不存在"),
    // 权限错误
    NO_OPERATOR_AUTH(450,"无权限操作"),
    NEED_ADMIND(451,"需要管理员权限"),
    // 文件操作
    FILE_UPLOAD_FAIL(460,"文件上传失败"),
    FILE_REMOVE_FAIL(461,"文件删除失败"),
    FILE_NOT_FOUND(462,"文件未找到"),
    BUCKET_OPERATE_FAIL(463,"操作桶失败"),
    // 服务错误
    SERVER_ERROR(500,"服务器内部错误");

    private final Integer code;
    private final String message;

    ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}

